Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start: Avoid string concatenation in inline asm. #21056

Merged
merged 4 commits into from
Aug 16, 2024

Conversation

alexrp
Copy link
Member

@alexrp alexrp commented Aug 12, 2024

I had the operator precedence wrong.

For csky, there are currently some LLVM issues blocking full compilation, so that mistake slipped through rather unsurprisingly. For riscv, I first added the gp initialization code unconditionally and tested it, but then I added the condition to exclude that code in self-hosted and neglected to actually test it with LLVM afterwards. The result was that it worked fine with the self-hosted backend, but not so with LLVM (which we have no CI coverage for due to #18872).

Copy link
Member

@andrewrk andrewrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use string literals only for inline assembly in preparation for #10761.

@alexrp
Copy link
Member Author

alexrp commented Aug 13, 2024

Done, and also included a workaround in the LLVM backend to ensure that frame pointers don't get used in naked functions.

@alexrp alexrp changed the title start: Fix ++ usage in inline asm string construction. start: Avoid string concatenation in inline asm. Aug 13, 2024
lib/std/start.zig Outdated Show resolved Hide resolved
lib/std/start.zig Outdated Show resolved Hide resolved
src/codegen/llvm.zig Outdated Show resolved Hide resolved
src/codegen/llvm.zig Outdated Show resolved Hide resolved
src/codegen/llvm.zig Outdated Show resolved Hide resolved
src/codegen/llvm.zig Outdated Show resolved Hide resolved
@alexrp
Copy link
Member Author

alexrp commented Aug 15, 2024

Folded #21070 into this one and removed the comptime workaround as a result.

@andrewrk andrewrk merged commit b917d77 into ziglang:master Aug 16, 2024
10 checks passed
@andrewrk
Copy link
Member

Thank you, looks great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants